const { tool,time,api } = getApp();
Page({

    data: {
        info: {},   // 用户信息
    },

    // 获取表单数据
    getForm(e) {
        let { open_id } = this.data.info;
        let { detail } = e;
        detail.leader_id = open_id;
        detail.invitation_code = detail.code;
        delete detail.code
        tool.createTeam(detail).then(res => {
            api.showToast('创建成功','success');
            setTimeout(() => {
                api.switchTab('/pages/group/list/index');
            }, 1000);
        })
    },

    // 页面加载
    onLoad(options) {
        tool.getUserInfo().then(info => {
            this.setData({ info });
        })
    },
    
})